import request from "@/axios";
import { Menu } from "@/types/menu";

export const getMenuList = (params?: Menu.MenuSearchQuery) => {
    return request({
        method: "get",
        url: "/api/system/menu",
        params,
    })
}
export const appendMenu = (data: Menu.Directory | Menu.Menu) => {
    return request({
        method: "post",
        url: "/api/system/menu",
        data,
    })
}
export const updateMenu = (data: Menu.Directory | Menu.Menu) => {
    return request({
        method: "put",
        url: "/api/system/menu",
        data,
    })
}
export const removeMenu = (id: string) => {
    return request({
        method: "delete",
        url: "/api/system/menu/" + id,
    })
}